package com.tedu.review.test;

abstract class Pig{

    public abstract void eat();

    public abstract void sleep();

}


public class 作业2 {
    public static void main(String[] args) {

        Pig pig=new Pig(){

            public void eat(){
                System.out.println("吃");
            }


            public void sleep(){
                System.out.println("睡");
            }
        };
        pig.eat();
        pig.sleep();

    }
}
